package Comparator;

import geometric3D.Point;

import java.util.Comparator;

/**
 * @author htd
 *sort the point n order y z x. small come first
 *that can change
 */
public class PointComparator implements Comparator<Point> {

	
	@Override
	public int compare(Point arg0, Point arg1) {
		if(arg0.getY() < arg1.getY()){
			return -1;
		}else if(arg0.getY() > arg1.getY()){
			return 1;
		}else if(arg0.getZ() < arg1.getZ()){
			return -1;
		}else if(arg0.getZ() > arg1.getZ()){
			return 1;
		}else if(arg0.getX() < arg1.getX()){
			return -1;
		}else if(arg0.getX() > arg1.getX()){
			return 1;
		}
		return 0;
	}

}
